package com.smarthome.web.property.controller.workingmonitor;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smarthome.core.workingmonitor.SystemLogService;
import com.smarthome.domain.bean.ShSysHeartbeat;
import com.smarthome.domain.vo.boss.TimeRange;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;
/**
 * 
* @ClassName: SystemLogController
* @Description: TODO(系统运行状态控制类)
* @author cyj
* @date 2015年9月28日 下午11:37:00
*
 */
@Controller
@RequestMapping("/systemLogController")
public class SystemLogController {

	@Resource
	private SystemLogService systemLogService;
	
	
	/**
	 * 
	* @Title: getPage 
	* @Description: TODO(根据条件获取系统运行状态数据列表) 
	* @param sysHeartbeat
	* @param timeRange
	* @param helper
	* @return
	* DataGrid
	* @throws 
	* @author cyj
	 */
	@RequestMapping("/dataGrid")
    @ResponseBody
	public DataGrid getPage(ShSysHeartbeat sysHeartbeat,TimeRange timeRange,PageHelper helper){
		if(timeRange.getStartGmtCreate() != null) {
			sysHeartbeat.addQueryData("startGmtCreate", timeRange.getStartGmtCreate());
		}
		if(timeRange.getEndGmtCreate() != null) {
			sysHeartbeat.addQueryData("endGmtCreate", timeRange.getEndGmtCreate());
		}
		
		return systemLogService.qeuryDataGrid(sysHeartbeat, helper);
	}
}
